import type { LoginResult } from '@/types/member'
import { request } from '@/utils/request'
type LoginParams = {
  code: string
  encryptedData: string
  iv: string
}
/** 小程序快捷登录
 *  针对非个人开发者使用
 */
export const loginAPI = (data: LoginParams) => {
  return request<LoginResult>({
    method: 'POST',
    url: '/login/wxMin',
    data,
  })
}
/** 模拟小程序快捷登录 */
export const postLoginAPI = (phoneNumber: string) => {
  return request<LoginResult>({
    method: 'POST',
    url: '/login/wxMin/simple',
    data: {
      phoneNumber,
    },
  })
}
